<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <title>任务汇报</title>
    <script type="text/javascript">

        $(function () {


            //异步请求生产计划编号
            $.get("scgl_scrwjhselectThiszhixing",
                null,function (data) {
                    var html="<select id='scgl_scrw_scjh_documentNum'  name='scgl_scrw_scjh_documentNum' onchange=\"show_sub()\" style=\"width: 100%;height: 100%\">\n" +
                        "                            <option  name='scgl_wzxqjh_mpp_id' value=\"\">请选择一个生产任务</option>";
                    for(i=0;i<data.scglScrws.length;i++){
                        html+= "<option value=\""+data.scglScrws[i].scglScrwDocumentnum+"\">"+data.scglScrws[i].scglScrwDocumentnum+"</option>";
                    }
                    html+= "</select>";

                    $("#scgl_scrw_scjh_select").append(html);

                });



        });
        //日期
        layui.use('laydate', function(){
            var laydate = layui.laydate;
            laydate.render({
                elem: '#scgl_scrw_documentDate' //指定元素
            });
            laydate.render({
                elem: '#scgl_rwhb_confirmDate' //指定元素
            });

        });
        //select的事件
        function show_sub(){
            $.get("/scgl_scrwjhselectOne?scglWzxqjhDocumentnum="+$("#scgl_scrw_scjh_documentNum").find("option:selected").val(),null,
                function (data) {
                    $("#scgl_scrw_confirmDate").val(""+data.scglScrw.scglScrwDocumentdate+"");
                    $("#scgl_scrw_scbm").val(""+data.scglScrw.scglScrwScbm+"");
                    $("#scgl_rehb_sczt_itemNum").val(""+data.scglScrw.scglScrwDocumentnum+"");
                    $("#scgl_rehb_sczt_itemName").val(""+data.scglScrw.scglScrwCurrentplannum+"");
                });
        }
        //非空验证
        function verify() {
            var scgl_scrw_documentNum = $("#scgl_scrw_documentNum").val();
            var scgl_scrw_subject = $("#scgl_scrw_subject").val();
            var scgl_scrw_scjh_documentNum = $("#scgl_scrw_scjh_documentNum").find("option:selected").val();
            var scgl_rwhb_singlePlayer = $("#scgl_rwhb_singlePlayer").val();
            var scgl_rwhb_confirmDate = $("#scgl_rwhb_confirmDate").val();
            var scgl_scrw_singlePlayer = $("#scgl_scrw_singlePlayer").val();
            var scgl_scrw_documentDate = $("#scgl_scrw_documentDate").val();
            var scgl_rehb_sczt_completeNum=$("#scgl_rehb_sczt_completeNum").val();
            var scgl_rehb_sczt_qualified=$("#scgl_rehb_sczt_qualified").val();
            var scgl_rehb_sczt_workingHour=$("#scgl_rehb_sczt_workingHour").val();


            var scgl_rehb_ryzt_actualNum=$("#scgl_rehb_ryzt_actualNum").val();
            var scgl_rehb_ryzt_attendeesPeople=$("#scgl_rehb_ryzt_attendeesPeople").val();
            var scgl_rehb_ryzt_attendeesWorkHoure=$("#scgl_rehb_ryzt_attendeesWorkHoure").val();
            var scgl_rehb_ryzt_workOvertime=$("#scgl_rehb_ryzt_workOvertime").val();
            var scgl_rehb_ryzt_shutDownTime=$("#scgl_rehb_ryzt_shutDownTime").val();
            var scgl_rehb_sczt_itemName1 = $("#scgl_rehb_sczt_itemName").val();


            if(!scgl_rehb_sczt_completeNum==""){
                if(scgl_rehb_sczt_completeNum>scgl_rehb_sczt_itemName1){
                    alert("完成数必须小于等于计划数");
                    return  false;
                }
            }
            if(!scgl_rehb_sczt_completeNum==""&&!scgl_rehb_sczt_qualified==""){
                if(scgl_rehb_sczt_completeNum<scgl_rehb_sczt_qualified){
                    alert("合格数需小于等于完成数");
                    return false;

                }

            }


            if (scgl_scrw_scjh_documentNum ==null||scgl_scrw_scjh_documentNum=="") {
                alert('源单不能为空');
                return false;
            }
            if (scgl_scrw_documentNum ==null||scgl_scrw_documentNum=="") {
                alert('单据编号不能为空');
                return false;
            }
            if (scgl_scrw_subject == null||scgl_scrw_subject=="") {
                alert('主题不能为空');
                return false;
            }
            if (scgl_scrw_singlePlayer ==null||scgl_scrw_singlePlayer=="" ) {
                alert('制单人不能为空');
                return false;
            }
            if (scgl_scrw_documentDate ==null||scgl_scrw_documentDate=="" ) {
                alert('制单日期不能为空');
                return false;
            }
            if (scgl_rwhb_singlePlayer == null||scgl_rwhb_singlePlayer=="" ) {
                alert('填报人不能为空');
                return false;
            }
            if (scgl_rwhb_confirmDate ==null||scgl_rwhb_confirmDate=="") {
                alert('填报时间不能为空');
                return false;
            }
            if (scgl_rehb_sczt_completeNum ==null||scgl_rehb_sczt_completeNum=="") {
                alert('完成数不能为空');
                return false;
            }
            if (scgl_rehb_sczt_qualified ==null||scgl_rehb_sczt_qualified=="") {
                alert('合格数不能为空');
                return false;
            }
            if (scgl_rehb_sczt_workingHour ==null||scgl_rehb_sczt_workingHour=="") {
                alert('工时不能为空');
                return false;
            }
            if(!scgl_rehb_sczt_completeNum ==null||!scgl_rehb_sczt_completeNum==""){
               if(isNaN(scgl_rehb_sczt_completeNum)){
                   alert('完成数必须为数字');
                   return false;
               }
            }
            if(!scgl_rehb_sczt_qualified ==null||!scgl_rehb_sczt_qualified==""){
                if(isNaN(scgl_rehb_sczt_qualified)){
                    alert('合格数必须为数字');
                    return false;
                }
            }
            if(!scgl_rehb_sczt_workingHour ==null||!scgl_rehb_sczt_workingHour==""){
                if(isNaN(scgl_rehb_sczt_workingHour)){
                    alert('工时必须为数字');
                    return false;
                }
            }
            if (scgl_rehb_ryzt_attendeesPeople ==null||scgl_rehb_ryzt_attendeesPeople=="") {
                alert('应到人数不能为空');
                return false;
            }
            if (scgl_rehb_ryzt_attendeesWorkHoure ==null||scgl_rehb_ryzt_attendeesWorkHoure=="") {
                alert('应有工时不能为空');
                return false;
            }
            if (scgl_rehb_ryzt_workOvertime ==null||scgl_rehb_ryzt_workOvertime=="") {
                alert('工时不能为空');
                return false;
            }
            if (scgl_rehb_ryzt_actualNum ==null||scgl_rehb_ryzt_actualNum=="") {
                alert('实到人数不能为空');
                return false;
            }
            if(!scgl_rehb_ryzt_actualNum ==null||!scgl_rehb_ryzt_actualNum==""){
                if(isNaN(scgl_rehb_ryzt_actualNum)){
                    alert('实到人数必须为数字');
                    return false;
                }
            }
            if(!scgl_rehb_ryzt_attendeesPeople ==null||!scgl_rehb_ryzt_attendeesPeople==""){
                if(isNaN(scgl_rehb_ryzt_attendeesPeople)){
                    alert('应到人数必须为数字');
                    return false;
                }
            }

            if(!scgl_rehb_ryzt_attendeesWorkHoure ==null||!scgl_rehb_ryzt_attendeesWorkHoure==""){
                if(isNaN(scgl_rehb_ryzt_attendeesWorkHoure)){
                    alert('应有工时必须为数字');
                    return false;
                }
            }
            if(!scgl_rehb_ryzt_workOvertime ==null||!scgl_rehb_ryzt_workOvertime==""){
                if(isNaN(scgl_rehb_ryzt_workOvertime)){
                    alert('加班工时必须为数字');
                    return false;
                }
            }
            if(!scgl_rehb_ryzt_shutDownTime ==null||!scgl_rehb_ryzt_shutDownTime==""){
                if(isNaN(scgl_rehb_sczt_workingHour)){
                    alert('停工工时必须为数字');
                    return false;
                }
            }



        }

    </script>
    <style>
        .scgl_scgl_firstul {
            margin-top: 10px;
        }

        .scgl_scgl_firstul li {
            list-style: none;
            float: left;
            margin-left: 10px;
        }
        .scgl_scgl_firstdiv {

            height: 55px;
            width: 100%;
            border: 2px solid slategray;
        }
        .scgl_scgl_secontdiv {
            margin-top: 10px;
            width: 100%;
            height: 150px;
        }
        .scgl_scgl_firsttable {
            width: 100%;
            height: 100%;
            border:slategray 2px solid ;

        }
        .scgl_scgl_firsttable tr {
            border-bottom: 2px solid slategray;

        }
        .scgl_scgl_firsttable_tr_td {
            background-color: #FFFFF0;
            border-right: 2px solid slategray;
            width: 14%;
            height: 25%;

        }
        .scgl_scgl_firsttable_tr_td01 {
            border-right: 2px solid slategray;
            width: 14%;
            height: 25%;

        }
        .scgl_scgl_firsttable_tr_td01 input{
            border: none;
            width: 100%;
            height: 100%;
        }
        .scgl_scgl_thirdiv {
            margin-top: 10px;
            width: 100%;
            height: 100px;
        }
        .scgl_scgl_secondtable {

            width: 100%;
            height: 100%;
            border:slategray 2px solid ;
        }

        .scgl_scgl_secondtable tr{
            border-bottom: 2px solid slategray;
        }

        .scgl_scgl_secondtable_tr_td {
            background-color: #FFFFF0;
            border-right: 2px solid slategray;
            width: 14%;
            height: 30px;
        }
        .scgl_scgl_secondtable_tr_td01 input {
            border: none;
            width: 100%;
            height: 100%;
        }
        .scgl_scgl_secondtable_tr_td01 {
            border-right: 2px solid slategray;
            width: 14%;
            height: 14%;
        }
        .scgl_scgl_thirdtable tr{
            border-bottom: 2px solid slategray;
        }
        .scgl_scgl_thirdtable_tr_td {

            border-right: 2px solid slategray;
            width: 11%;
            height: 30px;
        }
        .scgl_schb_firsttable {
            width: 100%;
            height: 100%;
            border:slategray 2px solid ;
            text-align: center;
        }
        .scgl_schb_firsttable tr{
            border-bottom: 2px solid slategray;
        }
        .scgl_schb_firsttable_tr_td {

            border-right: 2px solid slategray;
            width: 9%;
            height: 30px;
        }

        .scgl_schb_firsttable_tr_td input {
            border: none;
            width: 100%;
            height: 100%;
        }

    </style>
</head>
<body>
<!--form表单-->
<form action="/scgl_rwhbjInsert" onsubmit="return verify()">
    <div style="background-color: white">
    <!--页面主题-->
    <div style="height: 50px;width: 100%; font-weight: bold;text-align: center;font-size: 30px">新建任务汇报</div>


        <!--操作按钮-->
        <div class="scgl_scgl_firstdiv">
            <ul class="scgl_scgl_firstul">
                <li><input class="layui-btn layui-btn-radius" type="submit" value="保存"></li>
            </ul>
        </div>
        <!--需要填写的详细信息-->
        <div class="scgl_scgl_secontdiv">
            <table class="scgl_scgl_firsttable" cellpadding="0px" cellspacing="0px" border="2px" >
                <!--               第一行-->
                <tr>
                    <td colspan="6">基本信息</td>
                </tr>
                <!--                第二行-->
                <tr>
                    <td class="scgl_scgl_firsttable_tr_td">单据编号</td>
                    <td class="scgl_scgl_firsttable_tr_td01">
                        <input  type="text" id="scgl_scrw_documentNum" name="scgl_scrw_documentNum"/>
                    </td>
                    <td class="scgl_scgl_firsttable_tr_td">主题</td>
                    <td class="scgl_scgl_firsttable_tr_td01">
                        <input  type="text" id="scgl_scrw_subject" name="scgl_scrw_subject"/>
                    </td>
                    <td class="scgl_scgl_firsttable_tr_td">源单</td>
                    <td id="scgl_scrw_scjh_select" class="scgl_scgl_firsttable_tr_td01">

                    </td>
                </tr>
                <!--               第三行-->
                <tr >
                    <td class="scgl_scgl_firsttable_tr_td">生产部门</td>
                    <td  class="scgl_scgl_firsttable_tr_td01">
                        <input  type="text" readonly="readonly" id="scgl_scrw_scbm" name="scgl_scrw_scbm"/>
                    </td>
                    <td class="scgl_scgl_firsttable_tr_td">生产日期</td>
                    <td  class="scgl_scgl_firsttable_tr_td01">
                        <input  type="text"  readonly="readonly" id="scgl_scrw_confirmDate" name="scgl_scrw_confirmDate"/>
                    </td>
                    <td class="scgl_scgl_firsttable_tr_td">填报人</td>
                    <td  class="scgl_scgl_firsttable_tr_td01">
                        <input  type="text"  id="scgl_rwhb_singlePlayer" name="scgl_rwhb_singlePlayer"/>
                    </td>
                </tr>
                <!--              第四行-->
                <tr >
                    <td class="scgl_scgl_firsttable_tr_td">填报日期</td>
                    <td  class="scgl_scgl_firsttable_tr_td01">
                        <input  type="text" id="scgl_rwhb_confirmDate"  name="scgl_rwhb_confirmDate"/>
                    </td>
                    <td class="scgl_scgl_firsttable_tr_td"></td>
                    <td colspan="3" class="scgl_scgl_firsttable_tr_td01">
                    </td>
                </tr>
            </table>
        </div>
        <!-- /基本信息下需要填写的信息-->
        <!--     合计信息   -->
        <div class="scgl_scgl_thirdiv">
            <table class="scgl_scgl_secondtable" cellpadding="0px" cellspacing="0px" border="2px" >
                <!--     第三行-->
                <tr>
                    <td colspan="6"  class="scgl_scgl_secondtable_tr_td">备注信息</td>
                </tr>
                <!--               第四行-->
                <tr>
                    <td class="scgl_scgl_secondtable_tr_td">单据状态</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input  type="text" readonly="readonly" id="scgl_scrw_billsStatus"  name="scgl_scrw_billsStatus" value="结单"/>
                    </td>
                    <td class="scgl_scgl_secondtable_tr_td">制单人</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input  type="text" id="scgl_scrw_singlePlayer" name="scgl_scrw_singlePlayer"/>
                    </td>
                    <td class="scgl_scgl_secondtable_tr_td">制单日期</td>
                    <td class="scgl_scgl_secondtable_tr_td01">
                        <input type="text" name="scgl_scrw_documentDate" class="layui-input" id="scgl_scrw_documentDate">
                    </td>
                </tr>
                <!--     第七行-->
                <tr>
                    <td class="scgl_scgl_secondtable_tr_td">备注</td>
                    <td class="scgl_scgl_secondtable_tr_td01" colspan="5">
                        <input  type="text" id="scgl_scrw_remarks"  name="scgl_scrw_remarks"/>
                    </td>
                </tr>
            </table>
        </div>

</div>


<div style="width: 100%;height: 300px"  >
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li class="layui-this">生产状态</li>
            <li>人员状态</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <div style="width: 100%;height: 100px">
                    <table class="scgl_schb_firsttable" >
                        <tr >
                            <td class="scgl_schb_firsttable_tr_td">源单编号</td>
                            <td class="scgl_schb_firsttable_tr_td">计划数</td>
                            <td class="scgl_schb_firsttable_tr_td">完成数</td>
                            <td class="scgl_schb_firsttable_tr_td">合格数</td>
                            <td class="scgl_schb_firsttable_tr_td">合格率</td>
                            <td class="scgl_schb_firsttable_tr_td">工时</td>
                        </tr>
                        <tr >
                            <td class="scgl_schb_firsttable_tr_td">
                                <input  type="text" readonly="readonly" id="scgl_rehb_sczt_itemNum" name="scgl_rehb_sczt_itemNum"/>
                            </td>
                            <td class="scgl_schb_firsttable_tr_td">
                                <input  type="text" readonly="readonly" id="scgl_rehb_sczt_itemName" name="scgl_rehb_sczt_itemName"/>
                            </td>
                            <td class="scgl_schb_firsttable_tr_td">
                                <input  type="text" id="scgl_rehb_sczt_completeNum" name="scgl_rehb_sczt_completeNum"/>
                            </td>
                            <td class="scgl_schb_firsttable_tr_td">
                                <input  type="text" id="scgl_rehb_sczt_qualified" name="scgl_rehb_sczt_qualified"/>
                            </td>
                            <td class="scgl_schb_firsttable_tr_td">
                                <input  type="text" id="scgl_rehb_sczt_qualifiedRate" readonly="readonly" name="scgl_rehb_sczt_qualifiedRate" />
                            </td>
                            <td class="scgl_schb_firsttable_tr_td">
                                <input  type="text" id="scgl_rehb_sczt_workingHour" name="scgl_rehb_sczt_workingHour"/>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="layui-tab-item">
                <table class="scgl_schb_firsttable" >
                    <tr >
                        <td class="scgl_schb_firsttable_tr_td">应到人数</td>
                        <td class="scgl_schb_firsttable_tr_td">实到人数</td>
                        <td class="scgl_schb_firsttable_tr_td">应有工时</td>
                        <td class="scgl_schb_firsttable_tr_td">加班工时</td>
                        <td class="scgl_schb_firsttable_tr_td">停工工时</td>
                    </tr>
                    <tr >
                        <td class="scgl_schb_firsttable_tr_td">
                            <input  type="text" id="scgl_rehb_ryzt_attendeesPeople" name="scgl_rehb_ryzt_attendeesPeople"/>
                        </td>
                        <td class="scgl_schb_firsttable_tr_td">
                            <input  type="text"  id="scgl_rehb_ryzt_actualNum" name="scgl_rehb_ryzt_actualNum"/>
                        </td>
                        <td class="scgl_schb_firsttable_tr_td">
                            <input  type="text" id="scgl_rehb_ryzt_attendeesWorkHoure" name="scgl_rehb_ryzt_attendeesWorkHoure"/>
                        </td>
                        <td class="scgl_schb_firsttable_tr_td">
                            <input  type="text" id="scgl_rehb_ryzt_workOvertime" name="scgl_rehb_ryzt_workOvertime"/>
                        </td>
                        <td class="scgl_schb_firsttable_tr_td">
                            <input  type="text" id="scgl_rehb_ryzt_shutDownTime" name="scgl_rehb_ryzt_shutDownTime" />
                        </td>
                    </tr>
                </table>
            </div>

        </div>
    </div>
</div>
</form>
<!--/form表单-->


</body>
</html>